<template>
  <el-table :data="tableData" style="width: 100%">
    <el-table-column prop="date" label="日期" width="180" />
    <el-table-column prop="name" label="学号" width="180" />
    <el-table-column prop="address" label="姓名" />
  </el-table>
</template>


<script>
import { getCurrentInstance, reactive} from "vue";
export default{
     setup(){
        const {proxy} = getCurrentInstance()
        const tableData = reactive([
            {
                date: '2016-05-03',
                name: 'Tom',
                address: 'No. 189, Grove St, Los Angeles',
            },
            {
                date: '2016-05-02',
                name: 'Tom',
                address: 'No. 189, Grove St, Los Angeles',
            },
            {
                date: '2016-05-04',
                name: 'Tom',
                address: 'No. 189, Grove St, Los Angeles',
            },
            {
                date: '2016-05-01',
                name: 'Tom',
                address: 'No. 189, Grove St, Los Angeles',
            },
        ])

        tableData.push({date:'2022-05-01',name:'杨天宝',address:'大连民族大学'})
        var account = localStorage.getItem("account")
        var cname = localStorage.getItem("cname")
        var cno = localStorage.getItem("cno")
        var res1
        console.log(account)
        console.log(cname)
        console.log(cno)
        const obj = {sno:account}
        const go1 = async()=>{
            const res = await new proxy.$request(proxy.$urls.m().find,obj).modepost()
            return res.data
        }
        res1 = go1()
        res1.then(result=>{if (cno == '软件204') {
               for (var k in result.list){
                   tableData.push({date:result.list[k].date1,name:result.list[k].resqu,address:result.list[k].sno})
               }
        }})
                
    return {tableData}
    }


}
</script>
